import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';


class UserPage extends StatefulWidget {
  const UserPage({super.key});

  @override
  State<UserPage> createState() => _UserPageState();
}

class _UserPageState extends State<UserPage> {
  @override
  Widget build(BuildContext context) {

    ScreenUtil.init(context, designSize: const Size(750, 1334));

    return Container(
      child: ListView(
        children: [
          Container(
            height: 220.h,
            width: double.infinity,
            decoration: const BoxDecoration(
              image: DecorationImage(
                image: AssetImage("images/user_bg.jpg"),
                fit: BoxFit.cover
              )
            ),
            child: Row(
              children: [
                Container(
                  padding: const EdgeInsets.all(10),
                  child: ClipOval(
                    child: Image.asset("images/user.png",
                      fit: BoxFit.cover,
                      width: 120.w,
                      height: 100.h,
                    )
                  ),
                ),
                Expanded(
                  flex: 1,
                  child: InkWell(
                    onTap: (){
                      Get.toNamed("/login");
                    },
                    child: const Text("登录/注册",style: TextStyle(color: Colors.white)),
                  )
                )
              ],
            ),
          ),
          const ListTile(
            leading: Icon(Icons.assignment,color: Colors.red),
            title: Text("全部订单"),
          ),
          const Divider(),
          const ListTile(
            leading: Icon(Icons.payment,color: Colors.blue),
            title: Text("待付款"),
          ),
          const Divider(),
          const ListTile(
            leading: Icon(Icons.local_car_wash,color: Colors.orange),
            title: Text("待收获"),
          ),
          Container(
            width: double.infinity,
            height: 10,
            color: const Color.fromRGBO(242, 242, 242, 0.9)
          ),
          const ListTile(
            leading: Icon(Icons.favorite,color: Colors.lightGreen),
            title: Text("我的收藏"),
          ),
          const Divider(),
          const ListTile(
            leading: Icon(Icons.people,color: Colors.black54),
            title: Text("在线客服"),
          ),
          const Divider()
        ],
      ),
    );
  }
}